{#美化ui#}
{% extends 'base.html' %}
{% block content %}
<h2 class="mb-4">发布二手物品</h2>

<form method="post" class="card p-4 shadow-sm">
    <div class="mb-3">
        <label class="form-label">标题</label>
        <input type="text" name="title" class="form-control" placeholder="如：二手笔记本电脑" required>
    </div>

    <div class="mb-3">
        <label class="form-label">描述</label>
        <textarea name="description" class="form-control" rows="3" placeholder="详细描述商品的情况..."></textarea>
    </div>

    <div class="row mb-3">
        <div class="col">
            <label class="form-label">价格 (元)</label>
            <input type="number" step="0.01" name="price" class="form-control" required>
        </div>
        <div class="col">
            <label class="form-label">成色</label>
            <select name="condition" class="form-select">
                <option value="">请选择</option>
                <option>全新</option>
                <option>九成新</option>
                <option>八成新</option>
                <option>七成新</option>
            </select>
        </div>
    </div>

    <div class="mb-3">
        <label class="form-label">图片URL</label>
        <input type="url" name="image_url" class="form-control" placeholder="如：https://example.com/img.jpg">
    </div>

    <div class="mb-3">
        <label class="form-label">分类</label>
        <select name="category_id" class="form-select" required>
            <option value="">请选择分类</option>
            {% for category in categories %}
                <option value="{{ category.id }}">{{ category.name }}</option>
            {% endfor %}
        </select>
    </div>

    <button type="submit" class="btn btn-primary">发布物品</button>
</form>

{% endblock %}